﻿// Repair_Mp4.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include "Mp4.h"
#include "Track.h"
#include "utility.h"

#define FILE_PATH "E:\\VSProject\\repair-mp4\\NORM0001.MP4"
int main()
{
	

	/*char data[] = "cmd=delete_route_routeid+56sa4d1sad8_sada789asf13_asdad789732";
	char* pR = strchr(data, '+');


	while (pR)
	{
		char routeID[64] = {};
		char* pend = strchr(pR + 1, '_');
		if (pend)
		{
			strncpy(routeID, pR + 1, pend - pR - 1);
		}
		else
		{
			strcpy(routeID, pR + 1);
		}
		std::cout << routeID << std::endl;
		pR = pend;
	}
	return 0;*/


//	Mp4 mp4("NORM0152.MP4");
	
	CorruptTrack track(FILE_PATH);
	track.parseDamageStream();
	track.repairVideo();
//	track.repairVideo(mp4);

//	char data[25] = { 0x64, 0x00, 0x2a, 0xac, 0x2c, 0x6a, 0x81, 0xe0, 0x08, 0x9f, 0x96, 0x6e, 0x02, 0x02, 0x02, 0x80, 0x00, 0x00, 0x03, 0x00, 0x80, 0x00, 0x00, 0x19, 0x02 };


//	char data[17] = { 0x67 ,0x64, 0x00, 0x2a, 0xac, 0x2c, 0x6a, 0x81, 0xe0, 0x08, 0x9f, 0x96, 0x6e, 0x02, 0x02, 0x02, 0x04 };
	/*Sps_Stream sps;
	Sps_Info info;
	sps_parse(&sps, data, 25, &info);*/
	return 0;
}
